package com.mediacloud.app.newsmodule.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * 音频点播的广播
 * @author x
 *
 */
public class AudioVodBroadcast extends BroadcastReceiver
{

	public static final String Audio_UpdateTime="AudioVod_UpdateTime";
	public static final String AudioComplete="AudioVodComplete";
	public static final String SeekComplete="SeekComplete";
	public static final String TOGGLE_AUDIO ="toggle_vod_audio";
	private static final String TAG = AudioVodBroadcast.class.getSimpleName();
	public boolean isRegits = false;
	public AudioVodBroad audioLiveBroadHanlder;
	@Override
	public void onReceive(Context context, Intent intent) 
	{
		if(audioLiveBroadHanlder!=null)
		{
			String action=intent.getAction();
			if(Audio_UpdateTime.equals(action))
				audioLiveBroadHanlder.updateCurrentTime(intent);
			else if(AudioComplete.equals(action))
				audioLiveBroadHanlder.audioComplete(intent);
			else if(SeekComplete.equals(action))
				audioLiveBroadHanlder.seekComplete();
			else if(TOGGLE_AUDIO.equals(action)){
                audioLiveBroadHanlder.togglePauseAudio(intent);
            }
		}
	}
	/**
	 * 音频直播
	 * @author x
	 *
	 */
	public interface AudioVodBroad
	{
		void updateCurrentTime(Intent intent);
		void audioComplete(Intent intent);
		void seekComplete();
		void togglePauseAudio(Intent intent);
	}

}